<template>
  <div id="app">
    <nav>
      <!-- <router-link to="/">Home</router-link> | -->
      <!-- <router-link to="/about">About</router-link> -->
      <button @click="getuseRouter('/')">Home</button> |
      <button @click="getuseRouter('/about')">about</button>
    </nav>
    <router-view :value="11" @gatewayData="getGatewayData" />
  </div>
</template>
<script setup>
import { useRoute, useRouter } from 'vue-router/composables'
import { provide, reactive, ref } from 'vue'
provide('info', 'infouser')
const getGatewayData = (e) => {
  console.log('getGatewayData', e)
}
const route = useRoute()
const router = useRouter()

function getuseRouter(e) {
  router.push({
    path: e,
    query: { name: '888888', keyword: '666666' },
  })
}
</script>
<script>
export default {
  name: 'App',
  setup() {
    const info = ref('infouser')
    const state = reactive({
      count: 0,
    })
    return {
      info,
      state,
    }
  },
  mounted() {
    console.log('App mounted')
  },
  beforeCreate() {
    console.log('App beforeCreate')
  },

}
</script>
<style lang="scss">
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

nav {
  padding: 30px;

  a {
    font-weight: bold;
    color: #2c3e50;

    &.router-link-exact-active {
      color: #42b983;
    }
  }
}
</style>
